<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}基类{% endblock %}</title>
    {% block head_block %}
        {% include 'bbs/includes/head_script.html' %}
    {% endblock %}
</head>
<body>
<div class="layui-header header">
    <div class="layui-container">
        <div class="header-demo">
            <!-- 头部 logo -->
            <a href="./index.html" class="logo">
                <img src="/static/images/logo.png" alt="">
            </a>
            {% block menu %}
                <!-- 中间分类栏 -->
                <ul class="menu">
                    {% for cate in cate_list %}
                        <li><a href="/?cid={{ cate.id }}">{{ cate.name }}</a></li>
                    {% endfor %}
                </ul>
            {% endblock %}
            <!--登录注册栏-->
            <div class="login-btn">
                {% if current_user.is_active %}
                    <a href="/profile/{{ current_user.id }}">{{current_user.nick_name}}</a>
                    <a href="/logout">退出</a>
                {% else %}
                    <a href="/login" class="login_btn">登录</a> /
                    <a href="/register" class="register_btn">注册</a>
                {% endif %}
            </div>
        </div>
    </div>
</div>

<!--中间内容部分-->
<div class="layui-container">
    <!--新闻列表-->
    <div class="layui-row main" style="margin-top: 20px">
        <div class="layui-col-md9">
            {% block main %}
                main
            {% endblock %}
            <div id="pagination" style="text-align: center"></div>
        </div>
        <div class="layui-col-md3 layui-hide-xs">
            <div class="side">
                {% block author %}

                {% endblock %}
                <div class="rank">
                    <div class="rank_title">
                        <h3>热门文章</h3>
                    </div>
                    <div class="rank_list">
                        {% for hot_article in hot_article_list %}
                            <a href="/article/{{ hot_article.id }}">{{ hot_article.title }}</a>
                        {% endfor %}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


{% block foot_block %}
    {% include 'bbs/includes/foot_script.html' %}
{% endblock %}

</body>
</html>
